<template>
  <div>
    <el-button @click="handleClickRefresh"> 刷新 </el-button>
    <el-button @click="handleClickInsert" type="primary"> 添加 </el-button>
    <el-button> More </el-button>

    <div>
      <MyDialogInsert v-model="displayInsertDialog"> </MyDialogInsert>
    </div>
  </div>
</template>

<script>
import MyDialogInsert from "./dialog-insert.vue";

export default {
  name: "domains-toolbar",

  components: { MyDialogInsert },

  data() {
    return { displayInsertDialog: false };
  },

  methods: {
    fetch() {
      this.$store.dispatch("domains/fetch");
    },

    handleClickRefresh() {
      this.fetch();
    },

    handleClickInsert() {
      this.displayInsertDialog = true;
    },
  },

  mounted() {
    this.fetch();
  },
};
</script>
